libx86: Introduce a helper to serialise cpuid_policy objects
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 21 Jun 2018 14:35:49 +0000 (16:35 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 6 Nov 2018 17:51:18 +0000 (17:51 +0000)
commit43a9573a8ed7c32f019aa7251c26f9be03770a94
tree1b67c17f59998fcbc2012e8ce97ed1e78e76f33b
parentce2f42605888f18f63ff9fe0d45dd69ae83045bb
libx86: Introduce a helper to serialise cpuid_policy objects

The serialised form is made up of the leaf, subleaf and data tuple.  As this
is the architectural form, it is expected not to change going forwards.

The serialisation of the Xen/Viridian leaves isn't fully implemented yet.  It
is just enough to be bug-compatible with the current DOMCTL_set_cpuid
behaviour, but needs further hypervisor work before the toolstack can sensibly
control these values.

x86_cpuid_copy_to_buffer() is implemented using Xen's regular copy_to_guest
primitives, with an API-compatible memcpy() is used for the libxc half of the
build.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/include/public/arch-x86/xen.h
xen/include/xen/lib/x86/cpuid.h
xen/lib/x86/cpuid.c
xen/lib/x86/private.h